I try saving the value of NSURLVolumeURLKey when creating a bookmark. When resolving the bookmark later I pass the bookmark data to +resourceValuesForKeys:fromBookmarkData: but always pull out "file:///" which is wrong.
In contrast the value for NSURLVolumeURLForRemountingKey is properly saved and restored using the same method.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
I noticed that I cannot even tell that an NSBox is being used on macOS Tahoe when the system is in light mode. The 'box' background can't be seen so it makes it appear that the subviews in the box aren't positioned correctly (because they are inset from the subview outside the box). There is no visual indicator that that subviews inside this box are grouped together because well, you can't see the box at all.
In Interface Builder the box looks fine at Design Time in "Light Mode". In Dark Mode the box looks fine at design time and at run time.
Just figured I'd throw that out there.
So I noticed this:
A sheet window is presented.
The sheet window has some UI that makes it expandable say a little arrow expandable button.
Click the little expandable button. Now the sheet window controller calls - (void)setFrame:display:animate: on its window to resize.
The parent window flies across the screen to the lower left corner.
I'm on Tahoe 26.1. Seems to be related to NSSheetMoveHelper. Not sure how long this bug has been around. Workaround is to call -setFrame:display:animate: and pass NO to the animate flag. Then the sheet window resizes (but not animated which doesn't look as good as the old behavior but better than suddenly disappearing).
I think Apple may already knows about this bug b/c in an Apple app on Tahoe I see a sheet resizing being done with no animation...
When I run my Mac Catalyst app I'm getting unacceptable performance when resizing the window. Window resizing is very unresponsive/laggy.
Configuration:
The root view controller is a UISplitViewController (three pane split using UISplitViewControllerStyleTripleColumn).
Sidebar is configured. It's using a UICollectionView sidebar style (so it looks like NSOutlineView in AppKit).
On initial launch there is no selection and the second and third view controllers in the split have empty placeholder view controllers.
At this point window resizing is fine.
Now I make a selection in the sidebar. This populates the supplementary view controller with a view controller that uses a UITableView.
Now resizing the window performance is awful. Basically this is unusable. When resizing the window a bunch what looks to be Core Animation related logs flood the console during window resize:
cannot add handler to 3 from 1 - dropping Library: QuartzCore | Subsystem: com.apple.coreanimation
Now if I go to my app's Info.plist and add: UIDesignRequiresCompatibility entry with a value of TRUE and follow the same steps described above window resizing works as expected and I do not experience performance issues. Also with UIDesignRequiresCompatibility there is no "cannot add handlers" error logs flooding the console on window resize.
Returning to a Mac Catalyst app that I put to the side for awhile..when running it on Xcode 26.1 it crashes at launch with:
Assertion failure in -[NSToolbarItemGroupView _layoutWrapperViewsWithAttributes:], NSToolbarItemGroupView.m:599
No attributes were found for item
Call stack has a bunch of Autolayout code in AppKit like:
[NSWindow(NSConstraintBasedLayoutInternal) _layoutViewTree] + 120
50 AppKit 0x00000001911e8a10 -[NSWindow(NSConstraintBasedLayoutInternal) layoutIfNeeded] + 240
51 UIKitMacHelper 0x00000001a98f293c -[UINSWindow layoutIfNeeded] + 56
A few unnamed symbols mixed in maybe that's that Swiftness beneath the surface. App is just murdered on launch. I assume this is related to using NSToolbarItemGroup when building an NSToolbar...
I do see this log out:
NSToolbarItemGroup does not support selectionMode. Create the group with one of the class constructors to support selection.
Which is an interesting log so I commented out all calls to setSelectionMode: but still the same crash.
I do set the groups subitems property directly (I do not use the class constructors as the logging statement above indicates). I have no idea if using the class constructors will workaround this issue or not but I'm not particularly excited about that idea because I have items in the same toolbar group with different actions.
Appkit starting logging these warnings in macOS 26.1 about my app's MainMenu.
**Internal inconsistency in menus - menu <NSMenu: 0xb91b2ff80>
Title: AppName
Supermenu: 0xb91a50b40 (Main Menu), autoenable: YES
Previous menu: 0x0 (None)
Next menu: 0x0 (None)
Items: ()
believes it has [<NSMenuSubclassHereThisIsTheMenuBarMenuForMyApp:] 0xb91a50b40>
Title: Main Menu
Supermenu: 0x0 (None), autoenable: YES
Previous menu: 0x0 (None)
Next menu: 0x0 (None)
Items: (
) as a supermenu, but the supermenu does not seem to have any item with that submenu
**
I don't what that means. The supermenu is the menu that represents the menu used for my app's menu bar (as described by NSMenuSubclassHereThisIsTheMenuBarMenuForMyApp
Everything seems to work fine but log looks scary. Please don't throw!
I just updated to macOS 26.1.
I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get).
I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols.
With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things.
Additionally calling -sizeToFit on a button multiple times can cause it to shrink for example:
[button sizeToFit]; // <-- At fitting size
// Then later
[button sizeToFit]; // Now button is shrunk
But if the button is already at its fitting size an additional call later shouldn't make it shrink, it should stay the same size. FB20517174
I see I now inherit SwiftUI, not sure if that has anything to do with this but if I wanted to opt in to fragile layout I wouldn't be using Appkit...
I have Mac apps that embed “Helper Apps” inside their main bundle. The helper apps do work on behalf of the main application.
The helper app doesn’t show a dock icon, it does show minimal UI like an open panel in certain situations (part of NSService implementation). And it does make use of the NSApplication lifecycle and auto quits after it completes all work.
Currently the helper app is inside the main app bundle at: /Contents/Applications/HelperApp.app
Prior to Tahoe these were never displayed to user in LaunchPad but now the Spotlight based AppLauncher displays them.
What’s the recommended way to get these out of the Spotlight App list on macOS Tahoe?
Thanks in advance.
I have a custom object which gets passed back to the main app from XPC.
I whitelist it like so:
NSSet *expectedClass = [NSSet setWithObjects:[NSArray class],
[MyCustomClass class],
nil];
[interface setClasses:expectedClass forSelector:@selector(myMethodNameHere:withCompletion:)
argumentIndex:0
ofReply:YES];
Now my custom class conforms to NSSecureCoding. It does have an array property of another custom class.
@property (nonatomic,readonly) NSArray *arraypropertyOfOtherClass;
Which is decoded in -initWithCoder: using:
-decodeArrayOfObjectsOfClasses:forKey:
Now on macOS Tahoe this is all walking fine. But I just tested on macOS Monterey and I get the following error:
Exception: decodeObjectForKey: too many nested collections when explicitly decoding a single collection.
How should I handle this for earlier versions of macOS?
Getting this crash after I do this in PDFKit a lot:
PDFSelection *nextSelect = [self.pdfView.document findString:currentSearchString fromSelection:currentSelction withOptions:NSCaseInsensitiveSearch];
if (nextSelect != nil)
{
self.pdfView.currentSelection = nextSelect;
[self.pdfView scrollSelectionToVisible:nil];
}
Which often leads to:
0 CoreFoundation 0x000000019ced4770 __exceptionPreprocess + 176
1 libobjc.A.dylib 0x000000019c9b2418 objc_exception_throw + 88
2 CoreFoundation 0x000000019cfffe10 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 724
3 CoreFoundation 0x000000019cfa1ae4 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 52
4 PDFKit 0x00000001cb56e0fc -[PDFView _axPostPageChangeNotification:] + 348
5 Foundation 0x000000019e6a25e4 __NSFireDelayedPerform + 372
6 CoreFoundation 0x000000019ce92290 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 32
7 CoreFoundation 0x000000019ce91f50 __CFRunLoopDoTimer +
Looking to update one of my apps that uses SKStoreReviewController +requestReview (deprecated) to
AppStore.requestReview(in:)
umm...I have a few of questions...
Why is an NSViewController parameter required? It's really not so uncommon for an AppKit app to just use NSWindowController with a window that does not use NSViewController...
It should be possible to present the review request in a standalone alert (attached to a window is preferred IMO but it still should be possible to ask in separate window).
3)...why Swift..(err nevermind)
Ideally:
AppStore requestReview should take a NSWindow parameter but that parameter should be optional. If nil the request should be presented in a standalone window (like an alert). If non nil..present as a sheet on the window.
Why a view controller? Maybe I'm missing something.
I have an NSBrowser inside a window. When I start resizing a column I noticed a peculiar behavior: it causes NSWindowWillStartLiveResizeNotification to get posted for the NSWindow the browser is inside (and did end gets posted when column resizing finishes). The browser is not the NSWindow contentView but a descendant of the contentView.
I have my reasons for caring (I'm currently listening for these window resize notifications) but my code naively assumes that NSWindowWillStartLiveResizeNotification - NSWindowDidEndLiveResizeNotification indicates a window resizing session, not a column resizing session for the NSBrowser.
This is in contrast to NSOutlineView. When resizing columns in NSOutlineView the window resize notifications do not get posted.
NSBrowser deliberately kicks it off:
-[NSWindow _startLiveResize];
-[NSBrowser _resizeColumn:withEvent:] ()
So this seems quite intentional but is it necessary in modern macOS? Should I file a bug? I already did
FB20298148
I have some buttons. I set the bezelStyle to NSBezelStyleGlass.
I'm sometimes experiencing the following issue:
Put the system in dark mode.
Some glass buttons still draw with the light appearance.
One or more of the following actions usually makes the appearance redraw proper:
-Clicking the button
-Deactivating and then reactivating the window.
-Close and then reopen the window.
I tried setNeedsDisplay YES etc. but that didn't work
The delay is quite noticeable. Everything else is in dark mode except one or two glass buttons.
This seems to workaround the issue:
BOOL didToggleGlass = NO;
if (self.bezelStyle == NSBezelStyleGlass)
{
// Turn glass off just for a sec.
self.bezelStyle = NSBezelStyleToolbar;
didToggleGlass = YES;
}
if (didToggleGlass)
{
// Put glass back on.
self.bezelStyle = NSBezelStyleGlass;
}
Apparently toggling glass cause the effective appearance to change so you can't use the above workaround in a -viewDidChangeEffectiveAppearance b/c you'll create an infinite loop unless you guard against it.
I'm noticing some weird glitches with my collection view headers on macOS Tahoe.
The sections headers are pinned to the visible region. I headers fade out when scrolling and are supposed to fade back in but sometimes they don't fade back in and the header remains but the header text doesn't come back (until I scroll again).
How can I turn off this scroll animation thingy?
If I try making a bitmap of a NSButton using the following code:
NSBitmapImageRep *rep = [button bitmapImageRepForCachingDisplayInRect:button.bounds];
[button cacheDisplayInRect:button.bounds toBitmapImageRep:rep];
NSData *tiffData = rep.TIFFRepresentation;
I get a blank image if the NSButton has its bezelStyle set to NSBezelStyleGlass.
If I change the bezel style to something else like NSBezelStyleFlexiblePush I do get an image